import * as api from "./api";

export default {
  // 获取用户详情
  getDetails: params => {
    return api.get(`/api/users/center`);
  },
  // 更新用户详情
  updateDetails: params => {
    return api.put(`/api/users`, params);
  },
  // 切换语言
  switchLang: params => {
    return api.put(`/api/users/language-switch/${params.abb}`);
  },
  // 用户支付流水列表
  getTransferList: (params, page, isDisLoading) => {
    return api.get(`/api/users/transfer/${page.offset}`, params, {
      isDisLoading
    });
  },
  // 用户支付流水列详情
  getTransferDetails: params => {
    return api.get(`/api/users/transfer/${params.transferNo}/detail`);
  },
  //获取用户钱包
  getWallet: params => {
    return api.get(`/api/users/wallet`);
  },
  // 押金退款
  refundDepositt: type => {
    return api.put(`/api/users/refund?type=${type}`);
  },
  // 获取支付方式
  getPaymentMethod: params => {
    return api.get(`/api/users/paymentMethod/${params.type}/${params.amount}`);
  },
  // 绑卡
  bindBankCard: params => {
    return api.post(`/api/users/bankcard`, params);
  },
  // 解绑
  unBindBankCard: params => {
    return api.del(`/api/users/bankcard/${params.id}`);
  },
  // 支付
  toPay: params => {
    return api.post(`/api/users/payment`, params);
  },
  // 设置默认卡
  setDefaultCard: params => {
    return api.put(`/api/users/bankcard-default`, params);
  },
  sentStripeEmail: params => {
    return api.post("/api/users/receipts", params);
  }, //获取国家码
  getCountryCode: params => {
    return api.get(`/api/login/country`);
  }
};
